
package com.jf.cloud.service.sysmanager.remote;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import com.jf.cloud.service.sysmanager.common.db.Condition;
import com.jf.cloud.service.sysmanager.dao.IPubgClubService;
import com.jf.cloud.service.sysmanager.entity.PubgClub;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.jf.cloud.service.sysmanager.dao.IPubgMatchService;
import com.jf.cloud.service.sysmanager.common.base.AjaxPageData;
import com.jf.cloud.service.sysmanager.common.base.OPaging;
import com.jf.cloud.service.sysmanager.entity.PubgMatch;
import com.jf.cloud.service.sysmanager.support.web.BaseController;

import java.util.List;

/**
 * 赛事管理控制器
 * 
 * @author 代码机1.0 创建时间：2018-03-31
 */
@Controller
@RequestMapping("/pubgMatch")
public class PubgMatchController extends BaseController {

	/**
	 * 日志
	 */
	private static Log log = LogFactory.getLog(PubgMatchController.class);

	/**
	 * 赛事服务
	 */
	@Resource
	private IPubgMatchService pubgMatchService;

	/**
	 * 俱乐部服务
	 */
	@Resource
	private IPubgClubService pubgClubService;
	/**
	 * 后台赛事管理页面
	 *
	 * @author 高冬冬 2018年4月4日
	 */
	@RequestMapping("/list")
	public String list(HttpServletRequest request) {
		try {
			List<PubgClub> clubList = pubgClubService.findPubgClubList( new Condition());
			request.setAttribute("clubList", clubList);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "jsp/pubg/pubgMatch_list";
	}

	/**
	 * 后台赛事管理列表
	 *
	 * @author 高冬冬 2018年4月4日
	 */
	@ResponseBody
	@RequestMapping("/listPubgMatch.json")
	public AjaxPageData<PubgMatch> listPubgMatch(HttpServletRequest request, OPaging<PubgMatch> page) {
		return getAjaxPageData(pubgMatchService.findPage(page));
	}

}
